function updateIndexInfo (ajax_request) {
	var data = eval("(" + ajax_request.responseText + ")");
	
	for(var i=0;i<data.latestMovies.length;i++) {
		var _img_href = document.getElementById("mp_href_"+i);
		var _img = document.getElementById("moviePoster_"+i);
		
		_img_href.href = "movieInfo.jsp?movieID="+data.latestMovies[i].movieID;
		_img.src = window.basePath+data.latestMovies[i].moviePoster;
	}
}

function initIndex(){
	var href = "initIndex.do?startIndex=0&movieMax=6"; // load books
	ajaxRequest(href, updateIndexInfo, null);
}

